<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use yii\db\Query;

$query = new Query();
$array= $query->select('MerchandiseID')->from('tme_merchandiseinfo')->all();
$merchand=[];
foreach($array as $key=>$v){
	$merchand[] = $v['MerchandiseID'];
}
//默认显示入库类型
if($info->intype == 0)
	$intype = '正常入库';
elseif($info->intype ==1)
	$intype = '报损';
elseif($info->intype ==2)
	$intype = '报溢';
else
	$intype ='未知';
?>
<?php 
$form  = ActiveForm::begin([
		
		'enableClientScript'=>TRUE,
		'options'=>[
			'enctype'=>'multipart/form-data',
			'class'=>'form-horizontal'
		],
		'fieldConfig'=>[
			'template'=>'{label}<div class="col-sm-9">{input}{hint}<span class="help-inline col-xs-12 col-sm-7">{error}</span></div>',
			'labelOptions'=>['class'=>'col-sm-3 control-label no-padding-right'],
			'inputOptions'=>['class'=>'col-xs-10 col-sm-5'],
			'errorOptions'=>['class'=>'help-block middle']
		]		
]);
?>
<?= $form->field($model,'intype')->dropDownList([
		'0'=>'正常入库',
		'1'=>'报损',
		'2'=>'报溢'
],
		['prompt'=>$intype]//默认显示
)?>
<?= $form->field($model,'handler')->textInput(['value'=>$info->handler])?>
<?= $form->field($model,'merchandiseid')->dropDownList($merchand,['prompt'=>$detailinfo->merchandiseid])?>
<?= $form->field($model,'price')->textInput(['value'=>$detailinfo->price])?>
<?= $form->field($model,'num')->textInput(['value'=>$detailinfo->num])?>
<?= $form->field($model,'remark')->textInput(['value'=>$info->remark])?>
<label class="col-sm-3 control-label no-padding-right" for="testform-age"></label>
<?= Html::input('hidden','id',$id)?>			<!-- 传递id值到update操作 -->
<?= Html::submitButton('提交',[
		'class'=>'btn btn-danger',
		
]) ?>
&nbsp;&nbsp;&nbsp;&nbsp;
<?= Html::resetButton('重置',[
		'class'=>'btn btn-danger'
])?>

<?php 
$form = ActiveForm::end();
?>